package com.leyou.item.mapper;

import com.leyou.common.mapper.BaseMapper;
import com.leyou.item.entity.Brand;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface BrandMapper extends BaseMapper<Brand> {
    int insertCategoryBrand(@Param("bid") Long bid, @Param("ids") List<Long> ids);

    int deleteCategoryBrand(@Param("bid") Long bid);

    int deleteBrand(@Param("bid") Long bid);

    @Select("select tb.id,tb.name,tb.letter,tb.image " +
            "from tb_category_brand tcb " +
            "inner join tb_brand tb on tb.id=tcb.brand_id " +
            "where tcb.category_id=#{cid}")
    List<Brand> queryBrandByCategoryId(@Param("cid") Long categoryId);

}